<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *挪车记录
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$basic=$this->plugin_setting('basic');
	$return['htmls']=array();
		$card=array();
		$card['day']=pdo_count('jy_move_card',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ymd'))));
		$card['mounth']=pdo_count('jy_move_card',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ym'))));
		$card['all']=pdo_count('jy_move_card',array('uniacid'=>$_SESSION['uniacid']));
		
		$log=array();
		$log['day']=pdo_count('jy_move_log',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ymd'))));
		$log['mounth']=pdo_count('jy_move_log',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ym'))));
		$log['all']=pdo_count('jy_move_log',array('uniacid'=>$_SESSION['uniacid']));
		
		$member=array();
		$member['day']=pdo_count('jy_move_member',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ymd'))));
		$member['mounth']=pdo_count('jy_move_member',array('uniacid'=>$_SESSION['uniacid'],'createtime >'=>strtotime(date('ym'))));
		$member['all']=pdo_count('jy_move_member',array('uniacid'=>$_SESSION['uniacid']));
		
		$order=array();
		$order['day']=pdo_count('jy_move_order',array('uniacid'=>$_SESSION['uniacid'],'status'=>3,'createtime >'=>strtotime(date('ymd'))));
		$order['day']=$order['day']*$basic['express_fee'];
		$order['mounth']=pdo_count('jy_move_order',array('uniacid'=>$_SESSION['uniacid'],'status'=>3,'createtime >'=>strtotime(date('ym'))));
		$order['mounth']=$order['mounth']*$basic['express_fee'];
		$order['all']=pdo_count('jy_move_order',array('uniacid'=>$_SESSION['uniacid'],'status'=>3));
		$order['all']=$order['all']*$basic['express_fee'];
		
		$return['htmls']=array(
				array('type'=>'data','one_num'=>3,'title'=>'挪车数据-今日/总','datas'=>array(
					array('title'=>'挪车卡数据','num'=>2,'data'=>array($card['day'],$card['all'])),
					array('title'=>'挪车数据','num'=>2,'data'=>array($log['day'],$log['all'])),
					array('title'=>'订单金额','num'=>2,'data'=>array($order['day'],$order['all'])),
					array('title'=>'会员数据','num'=>2,'data'=>array($member['day'],$member['all'])),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'num'=>6,'ecid'=>'card','title'=>'挪车卡数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'今日申请次数','value'=>$card['day']),
						array('name'=>'当月审核次数','value'=>$card['mounth']),
						array('name'=>'总挪车卡个数','value'=>$card['all']),
					),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'num'=>6,'ecid'=>'logs','title'=>'挪车数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'今日挪车次数','value'=>$log['day']),
						array('name'=>'当月挪车次数','value'=>$log['mounth']),
						array('name'=>'总挪车次数','value'=>$log['all']),
					),
				)),
	);
	set_html('title','挪车概况');
	exi($return);
}